package dl.jf.service.impl;



import dl.jf.common.model.MUser;
import dl.jf.dao.idao.ILoginDao;
import dl.jf.dao.impl.LoginDaoImpl;
import dl.jf.service.iservice.ILoginService;

public class LoginServiceImpl implements ILoginService
{
	private ILoginDao loginDao;
	
	public void setLoginDao(ILoginDao loginDao) {
		this.loginDao = loginDao;
	}

	public boolean valid(String userId , String password)
	{
		MUser user = loginDao.getUserInfoByUserId(userId);
		boolean result = false;
		if (password.equals(user.getPassword()))
		{
			result = true;
		}
		user = null;
		return result;
	}
	
	public MUser getUserInfoByUserId(String userId)
	{
		MUser user = loginDao.getUserInfoByUserId(userId);
		return user;
	}
}
